home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
Pocket6.3
/
Source
/
PocketForthAppl.asm
< prev
next >
Wrap
Assembly Source File
|
1994-06-24
|
2KB
|
96 lines
; This file is: PocketForthAppl.asm - 8:57:51 PM 1/21/87
; 32 bit mode aware - 6/23/91
INCLUDE Traps.txt ; all of the toolbox macros
Start: _MoreMasters
PEA -4(A5) ; thePort(A5)
_InitGraf
_InitFonts
_InitWindows
_InitMenus
_TEInit
PEA Exit ; resume button action address
_InitDialogs
MOVE.L #$0000FFFF,D0 ; allEvents
_FlushEvents ; clear the event que
_InitCursor ; set cursor to the arrow
; load the DICT resource
CLR.L -(SP)
MOVE.L #'DICT',-(SP)
MOVE #257,-(SP)
_GetResource ; load DICT resource ID = 257
MOVE.L (SP)+,DictH(A5) ; stash handle in DictH
BEQ.S NoRoom
; Calculate the address of the DICT and jump to it
MOVE.L DictH(A5),A0 ; will pick it up and save it.
MOVE.L (A0),D0 ; get the start address
BSR.S AStrip ; mask out block identifier bits
MOVE.L D0,A0
LEA Expand,A1 ; carry this address, to the DICT
JMP (A0)
NoRoom: CLR -(SP) ; Room for dismiss item.
MOVE #258,-(SP) ; Push the resource ID.
CLR.L -(SP) ; no filter function
_StopAlert ; "red" alert box.
Exit: _ExitToShell
Expand: MOVE.L DictH(A5),A0
_HUnlock ; unlock the dictionary
MOVE.L DictH(A5),A0
_GetHandleSize ; add the passed in size ...
ADD (A6)+,D0 ; to the previous size and reset
MOVE.L DictH(A5),A0
_SetHandleSize ; the dictionary block size.
BNE.S NoRoom
MOVE.L DictH(A5),A0 ; re-lock it
_HLock
BNE.S NoRoom
MOVE.L DictH(A5),A0 ; will pick it up and save it.
MOVE.L (A0),D0 ; get the start address
BSR.S AStrip
MOVE.L D0,A0
JMP 4(A0)
AStrip: ; make sure the jump address (in D0) is 32 bit clean
MOVE.L D0,D3
; check for 64K ROM
MOVE #$A86E,D0 ; _InitGraf
_GetTrapAddress.newTool
MOVEA.L A0,A1
MOVE #$AA6E,D0 ; _InitGraf AND $200
_GetTrapAddress.newTool
MOVE.L D3,D0
CMPA.L A0,A1 ; if = then 64KROM
BEQ.S @0
; check for existance of _StripAddress
MOVE #$A89F,D0 ; _Unimplemented
_GetTrapAddress.newTool
MOVEA.L A0,A1
MOVE #$A055,D0 ; _StripAddress
_GetTrapAddress.newOS
MOVE.L D3,D0
CMPA.L A0,A1 ; is _StripAddress implemented?
BEQ.S @0
; mask out high byte unless 32 bit addressing mode
_StripAddress
RTS
; If _StripAddress doesn't exist, do it by hand
@0: ANDI.L #$FFFFFF,D0
RTS
DictH: DS.L 1 ; hold the DICT's handle
END